import { _decorator, Component, Node, Color } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('HelloWorld')
export class HelloWorld extends Component {
    lbNode: Node = null;
    start() {
        let plat: aa.Platform = aa.Platform.Android;
        aa.log('plat',plat);  //访问Base.ts中的全局枚举Platform
        aa.log('gameName',aa.gameName);  //访问Base.ts中的全局属性gameName
        aa.log('current',aa.current);  //访问Base.ts中的全局属性current
        aa.musicPlay('告白气球');  //访问Audio.ts中的全局方法musicPlay
        let labelNode = this.node.getChildByName('Label');
        //访问Palette.ts中的全局组件Palette
        let pal: aa.Palette = labelNode.addComponent(aa.Palette);
        pal.colorLB = new Color(255, 0, 0);  //设置左下角颜色
        pal.colorRB = new Color(255, 0, 0);  //设置右下角颜色
    }
}